package GUI.Ventas.Facturacion;

import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;

public class buscarPor extends Dialog {

	protected Object result;
	protected Shell shell;

	/**
	 * Create the dialog.
	 * @param parent
	 * @param style
	 */
	public buscarPor(Shell parent, int style) {
		super(parent, style);
		setText("SWT Dialog");
	}

	/**
	 * Open the dialog.
	 * @return the result
	 */
	public Object open() {
		createContents();
		shell.open();
		shell.layout();
		Display display = getParent().getDisplay();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		return result;
	}

	/**
	 * Create contents of the dialog.
	 */
	private void createContents() {
		shell = new Shell(getParent(), getStyle());
		shell.setSize(397, 219);
		shell.setText(getText());
		shell.setLayout(new FormLayout());
		
		Button btnBuscarPorCedula = new Button(shell, SWT.NONE);
		FormData fd_btnBuscarPorCedula = new FormData();
		fd_btnBuscarPorCedula.top = new FormAttachment(0, 38);
		fd_btnBuscarPorCedula.left = new FormAttachment(0, 98);
		btnBuscarPorCedula.setLayoutData(fd_btnBuscarPorCedula);
		btnBuscarPorCedula.setText("Buscar por Cedula de Identidad");
		
		Button btnNewButton = new Button(shell, SWT.NONE);
		FormData fd_btnNewButton = new FormData();
		fd_btnNewButton.right = new FormAttachment(0, 298);
		fd_btnNewButton.top = new FormAttachment(btnBuscarPorCedula, 27);
		fd_btnNewButton.left = new FormAttachment(0, 98);
		btnNewButton.setLayoutData(fd_btnNewButton);
		btnNewButton.setText("Seleccionar de la lista de Clientes");

	}

}
